<?php

namespace App\Service\Log;

use Exception;
use Illuminate\Support\Facades\Log;

class LogService
{
    public static function debug($e, $remark) {
        if ($e instanceof Exception) {
            $data = [
                'code' => $e->getCode(),
                'msg' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
            ];
        }else {
            $data = [
                'msg' => $e
            ];
        }
        Log::debug(
            "[调试日志][${remark}]".
            json_encode($data)
        );
    }
}
